package cn.exrick.xboot.modules.transport.baoxian.dto;

import lombok.Data;

import javax.xml.bind.annotation.*;

@Data
@XmlRootElement(name = "PolicyList")
@XmlAccessorType(XmlAccessType.FIELD)
public class RateQueryRequest {

    // -------------------- 基础字段 --------------------
    @XmlAttribute(name = "username")
    private String username; // 开户名（20字符）

    @XmlElement(name = "Policy")
    private Policy policy = new Policy();

    // -------------------- 内部 Policy 对象 --------------------
    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Policy {
        @XmlAttribute(name = "BusinessLogic")
        private final String businessLogic = "QueryApprovalratioByMessages"; // 固定字段

        @XmlElement(name = "InsuranceId")
        private String insuranceId = "1";        // 险种 (1-国内，2-进出口 | MD5校验)

        @XmlElement(name = "GoodsTypeNo")
        private String goodsTypeNo = "620100";        // 货物类型代码 (MD5校验)

        @XmlElement(name = "IfPack")
        private String ifPack = "F";             // 包装 (T/F | MD5校验)

        @XmlElement(name = "TransPortType")
        private String transportType = "公路";      // 运输方式

        @XmlElement(name = "MainGlausesCode")
        private String mainClauseCode = "YDG001";     // 主险代码 (MD5校验)

        @XmlElement(name = "Range")
        private String range;              // 运输范围 (国内/进口/出口远洋/出口港澳)

        @XmlElement(name = "ToLoc")
        private String toLoc;              // 目的地

        @XmlElement(name = "MD5Key")
        private String md5Key;             // 32位签名
    }
}
